<?php
/*
 * @Description: 路由
 * @Author: QianLong
 * @Date: 2019-11-07 22:41:07
 * @LastEditors    : QianLong
 * @LastEditTime   : 2024-05-15 10:27:41
 */

declare(strict_types=1);

use Hyperf\HttpServer\Router\Router;

Router::addGroup(
    '/mp_weixin/',
    function () {
        Router::post('callback/{mw_id}', 'App\Controller\MpWeixinController@callback');
        Router::get('callback/{mw_id}', 'App\Controller\MpWeixinController@callback');
        Router::get('oauth', 'App\Controller\MpWeixinController@oauth');
    },
    ['middleware' => [App\Middleware\Api\ExtendMiddleware::class]]
);
Router::addGroup(
    '/mp_weixin_api/',
    function () {
        Router::get('getAllMedia', 'App\Controller\MpWeixinApiController@getAllMedia');
        Router::post('createMenu', 'App\Controller\MpWeixinApiController@createMenu');
    },
    ['middleware' => [App\Middleware\Api\ExtendMiddleware::class]]
);
Router::addGroup(
    '/contract/',
    function () {
        Router::get('getFile', 'App\Controller\ContractController@getFile');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/mpWeixinApi/',
    function () {
        Router::get('getAccessToken', 'App\Controller\MpWeixinApiController@getAccessToken');
        Router::post('sendTemplateMsg', 'App\Controller\MpWeixinApiController@sendTemplateMsg');
        Router::post('sendKfMsg', 'App\Controller\MpWeixinApiController@sendKfMsg');
        Router::post('getQrcode', 'App\Controller\MpWeixinApiController@getQrcode');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/wxWorkApi/',
    function () {
        Router::get('getAccessToken', 'App\Controller\WxWorkController@getAccessToken');
        Router::post('getAccessToken', 'App\Controller\WxWorkController@getAccessToken');
        Router::post('sendTemplateMsg', 'App\Controller\WxWorkController@sendTemplateMsg');
        Router::post('oauthLogin', 'App\Controller\WxWorkController@oauthLogin');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/socket/',
    function () {
        Router::post('server_push', 'App\Controller\WebSocketApiController@server_push');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/captcha/',
    function () {
        Router::get('getCaptcha', 'App\Controller\CaptchaController@getCaptcha');
        Router::post('verify', 'App\Controller\CaptchaController@verify');
    },
    ['middleware' => [App\Middleware\Api\ExtendMiddleware::class]]
);
Router::addGroup(
    '/common/',
    function () {
        Router::get('getSocketInfo', 'App\Controller\CommonController@getSocketInfo');
    },
    ['middleware' => [App\Middleware\Api\ExtendMiddleware::class]]
);
Router::addGroup(
    '/adsApi/',
    function () {
        Router::get('getAdsList', 'App\Controller\AdsApiController@getAdsList');
        Router::post('getAdsList', 'App\Controller\AdsApiController@getAdsList');
    },
    ['middleware' => [App\Middleware\Api\ExtendMiddleware::class]]
);
Router::addGroup(
    '/website/',
    function () {
        Router::get('control', 'App\Controller\WebsiteController@control');
        Router::post('control', 'App\Controller\WebsiteController@control');
        Router::post('spider_push', 'App\Controller\WebsiteController@spider_push');
        Router::get('slide', 'App\Controller\WebsiteController@slide');
        Router::post('slide', 'App\Controller\WebsiteController@slide');
    },
    ['middleware' => [App\Middleware\Api\ExtendMiddleware::class]]
);
Router::addGroup(
    '/email/',
    function () {
        Router::post('send', 'App\Controller\EmailController@send');
        Router::post('send2', 'App\Controller\EmailController@send2');
        Router::get('getCate', 'App\Controller\EmailController@getCate');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/mp_miniapp/',
    function () {
        Router::post('login', 'App\Controller\MpMiniAppController@login');
        Router::post('getUnLimitedQrcode', 'App\Controller\MpMiniAppController@getUnLimitedQrcode');
        Router::get('getUrlLink', 'App\Controller\MpMiniAppController@getUrlLink');
        Router::post('getUrlLink', 'App\Controller\MpMiniAppController@getUrlLink');
        Router::get('getAccessToken', 'App\Controller\MpMiniAppController@getAccessToken');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/platform/',
    function () {
        Router::post('ak', 'App\Controller\PlatformController@ak');
        Router::get('serverIp', 'App\Controller\PlatformController@serverIp');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/article/',
    function () {
        Router::get('all_list', 'App\Controller\ArticleController@all_list');
        Router::get('list', 'App\Controller\ArticleController@list');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/log/',
    function () {
        Router::post('push', 'App\Controller\LogController@push');
        Router::post('push_v2', 'App\Controller\LogController@push_v2');
    },
    ['middleware' => [App\Middleware\Api\ExtendMiddleware::class]]
);
Router::addGroup(
    '/feedback/',
    function () {
        Router::post('site', 'App\Controller\FeedbackController@site');
        Router::post('site_submit', 'App\Controller\FeedbackController@site_submit');
        Router::post('site_submit_v2', 'App\Controller\FeedbackController@site_submit_v2');
        Router::post('site_submit_v3', 'App\Controller\FeedbackController@site_submit_v3');
        Router::get('list', 'App\Controller\FeedbackController@list');
    },
    ['middleware' => [App\Middleware\Api\ExtendMiddleware::class]]
);
Router::addGroup(
    '/app/',
    function () {
        Router::post('upgrade', 'App\Controller\AppController@upgrade');
        Router::post('info', 'App\Controller\AppController@info');
    },
    ['middleware' => [App\Middleware\Api\ExtendMiddleware::class]]
);
Router::addGroup(
    '/sms/',
    function () {
        Router::post('send', 'App\Controller\SmsController@send');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/sms/',
    function () {
        Router::post('aliyunSmsReport/{dev_key}', 'App\Controller\SmsController@aliyunSmsReport');
        Router::get('aliyunSmsReport/{dev_key}', 'App\Controller\SmsController@aliyunSmsReport');
        Router::post('aliyunSmsUp/{dev_key}', 'App\Controller\SmsController@aliyunSmsUp');
        Router::get('aliyunSmsUp/{dev_key}', 'App\Controller\SmsController@aliyunSmsUp');
    },
    ['middleware' => [App\Middleware\Api\ExtendMiddleware::class]]
);
Router::addGroup(
    '/push/',
    function () {
        Router::post('send', 'App\Controller\PushController@send');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/ip/',
    function () {
        Router::get('search', 'App\Controller\IpController@search');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/file/',
    function () {
        Router::post('upload', 'App\Controller\FileController@upload');
        Router::get('getFileUrl', 'App\Controller\FileController@getFileUrl');
        Router::post('getFileUrl', 'App\Controller\FileController@getFileUrl');
        Router::post('deleteFile', 'App\Controller\FileController@deleteFile');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/schedule/',
    function () {
        Router::post('save', 'App\Controller\ScheduleController@save');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::addGroup(
    '/short_url/',
    function () {
        Router::post('make', 'App\Controller\ShortController@make_short_url');
    },
    ['middleware' => [App\Middleware\Api\ApiMiddleware::class]]
);
Router::get('/schedule/notice', 'App\Controller\ScheduleController@notice');
Router::get('/push/webhook', 'App\Controller\PushController@webhook');
Router::post('/push/webhook', 'App\Controller\PushController@webhook');
Router::get('/email/img', 'App\Controller\EmailController@img');
Router::get('/u/{id}', 'App\Controller\ShortController@toUrl');
Router::get('/clickAds/{id}/{from}', 'App\Controller\AdsController@toUrl');
Router::get('/clickAds/{id}', 'App\Controller\AdsController@toUrl');
Router::get('/clickAds2/{id}', 'App\Controller\AdsController@toUrl2');
Router::get('/', 'App\Controller\CommonController@home');
Router::get('', 'App\Controller\CommonController@home');
Router::get('/favicon.ico', function () {
    return '';
});
Router::addServer('socket-io', function () {
    Router::get('/', 'App\Controller\WebSocketController');
    Router::get('/xf_knowledge_chat', 'App\Controller\XfKnowledgeChatController');
});